﻿
using System;
using ImageConverter.Data.Containers;
using ImageConverter.Model.Enums;
namespace ImageConverter.Model
{
    public class EntryContainerFactory : IEntryContainerFactory
    {
        #region IContainerFactory Members

        public IEntryReader Create()
        {
            switch (productType)
            {
                case ContainerTypeEnum.Folders:
                    return new FileSystemReader();
                case ContainerTypeEnum.Zip:
                    return new SevenZipReader();
                case ContainerTypeEnum.Rar:
                    return new SevenZipReader();
                default:
                    throw new NotImplementedException("Unknown type of container");
            }
        }

        public void SetProductType(ContainerTypeEnum productType)
        {
            this.productType = productType;
        }

        #endregion

        private ContainerTypeEnum productType;
    }
}
